/**
 * 
 */
package fr.ece.ing4.si.mc.MonteCarlo;

import fr.ece.ing4.si.mc.gui.ResultWindow;

/**
 * @author Cesar Berezowski, Gaspard Peyrot
 */
public abstract class MonteCarloAbstract implements Runnable {

	/**
	 * 
	 */
	public MonteCarloAbstract() { }
	
	/**
	 * To build the controller
	 * @param callPutFlag
	 * @param s
	 * @param x
	 * @param r
	 * @param t
	 * @param b
	 * @param v
	 * @param nSteps
	 * @param nSimulations
	 * @param myView
	 */
	public abstract void build(String callPutFlag, double s, double x, double r, double t, 
			double b, double v,int nSteps, int nSimulations, ResultWindow myView);
	
	/**
	 * Factory : creates the multi or single controller depending on type
	 * @param type single or multi
	 * @return constructed controller
	 */
	public static MonteCarloAbstract buildMC(String type){
		
		if(type == "multi") return new MultiMonteCarloController();
		else if(type == "single") return new SingleMonteCarloController();
		else return null;
	}
	
	/**
	 * Launch computation
	 */
	public abstract void calculate();
	
	/**
	 * Update progress bar in the result window
	 */
	public abstract void updateProgress();

}
